home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / contrib / subeqnarray.sty < prev    next >
Encoding:
Text File  |  1995-03-15  |  5.5 KB  |  138 lines

  1. %% 
  2. %% This is file `subeqnarray.sty', generated 
  3. %% on <1995/3/5> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% subeqnarray.dtx  (with options: `package')
  8. %% 
  9. %% Copyright (C) 1988--1994 by Johannes Braams. 
  10. %% All rights reserved. 
  11. %% 
  12. %% IMPORTANT NOTICE: 
  13. %% 
  14. %% You are not allowed to change this file. You may however copy 
  15. %% this file to a file with a different name and then change the copy. 
  16. %% 
  17. %% You are allowed to distribute this file under the condition that it 
  18. %% is accompanied by subeqnarray.dtx, its source. 
  19. %% 
  20. %% You are NOT ALLOWED to distribute this file alone. You are NOT 
  21. %% ALLOWED to take money for the distribution or use of either this 
  22. %% file or a changed version, except for a nominal charge for copying 
  23. %% etc. 
  24. %% 
  25. %% For error reports in case of UNCHANGED versions see subeqnarray.dtx. 
  26. %% 
  27. %% Please do not request updates from me directly. Distribution is 
  28. %% done through Mail-Servers and TeX organizations. 
  29. %% 
  30. \def\fileversion{2.1}
  31. \def\filedate{1994/02/10}
  32. \def\docdate{1994/02/09}
  33. %%% ====================================================================
  34. %%%  @LaTeX-package-file{
  35. %%%     author          = "Braams J.L.",
  36. %%%     version         = "2.1",
  37. %%%     date            = "10 February 1994",
  38. %%%     time            = "01:27:31 MET",
  39. %%%     filename        = "subeqnarray.dtx",
  40. %%%     address         = "PTT Research
  41. %%%                        St. Paulusstraat 4
  42. %%%                        2264 XZ Leidschendam
  43. %%%                        The Netherlands",
  44. %%%     telephone       = "(70) 3325051",
  45. %%%     FAX             = "(70) 3326477",
  46. %%%     checksum        = "13995 400 1471 13429",
  47. %%%     email           = "J.L.Braams@research.ptt.nl (Internet)",
  48. %%%     codetable       = "ISO/ASCII",
  49. %%%     keywords        = "",
  50. %%%     supported       = "yes",
  51. %%%     abstract        = "This package defines the subeqnarray
  52. %%%                        and subeqnarray* environments, which behave
  53. %%%                        like the eqnarray environment, except that
  54. %%%                        the lines are numbered like 1a 1b 1c etc.
  55. %%%                        To refer to these numbers an extra label
  56. %%%                        command \slabel has been defined
  57. %%%
  58. %%%                        The equations and their numbers adhere to
  59. %%%                        the standard LaTeX options leqno and fleqn.",
  60. %%%     docstring       = "The checksum field above contains a CRC-16
  61. %%%                        checksum as the first value, followed by the
  62. %%%                        equivalent of the standard UNIX wc (word
  63. %%%                        count) utility output of lines, words, and
  64. %%%                        characters.  This is produced by Robert
  65. %%%                        Solovay's checksum utility.",
  66. %%%  }
  67. %%% ====================================================================
  68. \ProvidesPackage{subeqnarray}[\filedate\space subeqnarray package]
  69. \wlog{Package `subeqnarray' version \fileversion\space<\filedate> (JLB)}
  70. \wlog{English documentation\space\space\space<\docdate> (JLB)}
  71. \newcounter{subequation}[equation]
  72. \def\thesubequation{\theequation\alph{subequation}}
  73. \DeclareOption{leqno}{%
  74.   \def\@subeqnnum{\hbox to .01\p@{}\rlap{\reset@font\rmfamily
  75.         \hskip -\displaywidth(\thesubequation)}}}
  76. \DeclareOption{reqno}{%
  77.   \def\@subeqnnum{{\reset@font\rmfamily (\thesubequation)}}}
  78. \DeclareOption{fleqn}{%
  79.   \def\subeqn@start{%
  80.     \tabskip\mathindent
  81.     \abovedisplayskip\topsep
  82.     \ifvmode\advance\abovedisplayskip\partopsep\fi
  83.     \belowdisplayskip\abovedisplayskip
  84.     \belowdisplayshortskip\abovedisplayskip
  85.     \abovedisplayshortskip\abovedisplayskip
  86.     $$\everycr{}\halign to \linewidth}}% $$
  87. \DeclareOption{deqn}{%
  88.   \def\subeqn@start{%
  89.     \tabskip\@centering
  90.     $$\everycr{}\halign to \displaywidth}}% $$
  91. \DeclareOption*{\OptionNotUsed}
  92. \ExecuteOptions{reqno,deqn}
  93. \ProcessOptions
  94. \newcommand\slabel[1]{%
  95.   \@bsphack
  96.   \if@filesw
  97.     {\let\thepage\relax
  98.      \def\protect{\noexpand\noexpand\noexpand}%
  99.      \edef\@tempa{\write\@auxout{\string
  100.         \newlabel{#1}{{\thesubequation}{\thepage}}}}%
  101.      \expandafter}\@tempa
  102.      \if@nobreak \ifvmode\nobreak\fi\fi
  103.   \fi\@esphack}
  104. \newenvironment{subeqnarray}%
  105.    {\stepcounter{equation}%
  106.     \def\@currentlabel{\p@equation\theequation}%
  107.     \global\c@subequation\@ne
  108.     \global\@eqnswtrue\m@th
  109.     \global\@eqcnt\z@\let\\\@subeqncr
  110.     \subeqn@start
  111.      \bgroup\hskip\@centering
  112.       $\displaystyle\tabskip\z@skip{##}$\@eqnsel
  113.       &\global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil
  114.       &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
  115.          $\displaystyle{##}$\hfil \tabskip\@centering
  116.       &\global\@eqcnt\thr@@
  117.          \hbox to\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}
  118.    {\@@subeqncr\egroup $$\global\@ignoretrue}
  119. \def\@subeqncr{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
  120.     \@ysubeqncr}{\global\@eqpen\interdisplaylinepenalty \@ysubeqncr}}
  121. \def\@ysubeqncr{\@ifnextchar [{\@xsubeqncr}{\@xsubeqncr[\z@skip]}}
  122. \def\@xsubeqncr[#1]{\ifnum0=`{\fi}\@@subeqncr
  123.    \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
  124. \def\@@subeqncr{\let\@tempa\relax
  125.     \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}
  126.       \or \def\@tempa{&}\else
  127.        \let\@tempa\@empty
  128.        \@latexerr{Too many columns in subeqnarray environment}\@ehc\fi
  129.      \@tempa \if@eqnsw\@subeqnnum\refstepcounter{subequation}\fi
  130.      \global\@eqnswtrue\global\@eqcnt\z@\cr}
  131. \newenvironment{subeqnarray*}%
  132.   {\def\@subeqncr{\nonumber\@ssubeqncr}\subeqnarray}
  133.   {\global\advance\c@equation\m@ne\nonumber\endsubeqnarray}
  134. \let\@ssubeqncr\@subeqncr
  135. \endinput
  136. %% 
  137. %% End of file `subeqnarray.sty'.
  138.